package com.pg.agent.engine.service.utils;

import cn.hutool.core.util.ObjectUtil;
//import com.azure.ai.openai.OpenAIClient;
//import com.azure.ai.openai.OpenAIClientBuilder;
//import com.azure.ai.openai.models.Embeddings;
//import com.azure.ai.openai.models.EmbeddingsOptions;
//import com.azure.core.credential.AzureKeyCredential;

import java.util.Arrays;

public class AzureOpenAIUtils {

//    /**
//     * 获取embedding
//     *
//     * @param query
//     * @param key
//     * @param deploymentOrModelId
//     * @param endpoint
//     * @return
//     */
//    public static Embeddings getEmbedding(String query, String key, String deploymentOrModelId, String endpoint) {
//
//        // query is null 或者空，不执行向量处理
//        if (ObjectUtil.isEmpty(query)) {
//            return null;
//        }
//        OpenAIClient client = new OpenAIClientBuilder()
//                .credential(new AzureKeyCredential(key))
//                .endpoint(endpoint)
//                .buildClient();
//
//        EmbeddingsOptions embeddingsOptions = new EmbeddingsOptions(
//                Arrays.asList(query));
//
//        Embeddings embeddings = client.getEmbeddings(deploymentOrModelId, embeddingsOptions);
//        return embeddings;
//
//    }

}
